package org.android.donottrack.api;

import android.content.ContentResolver;
import android.content.Context;
import android.provider.Settings.Secure;

public class CupcakeSupport implements SupportUtil {

	protected Context context;

	public CupcakeSupport(Context context) {
		this.context = context;
	}

	public boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
		return Secure.getString(cr, Secure.LOCATION_PROVIDERS_ALLOWED)
				.contains(provider);
	}

	public void setLocationProviderEnabled(ContentResolver cr, String provider,
			boolean enabled) {
		if (enabled) {
			provider = "+" + provider;
		} else {
			provider = "-" + provider;
		}
		Secure.putString(cr, Secure.LOCATION_PROVIDERS_ALLOWED, provider);
	}
}
